package com.uphone.kingmall.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.blankj.utilcode.util.SizeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.china.zhuoyue.R;
import com.uphone.kingmall.bean.GoodsListBean;
import com.uphone.kingmall.utils.GlideUtils;

/**
 * <pre>
 *     author : radish
 *     e-mail : 15703379121@163.com
 *     time   : 2019/3/18
 *     desc   :
 * </pre>
 */
public class PinpaiListAdapter extends BaseQuickAdapter<GoodsListBean.DataBean, BaseViewHolder> {
    public PinpaiListAdapter(Context context) {
        super(R.layout.kingmall_item_goodslist_liner);
        this.mContext = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, GoodsListBean.DataBean item) {

        ImageView icon = helper.getView(R.id.iv_icon);
        GlideUtils.getInstance().loadCornerImage(mContext, item.getGoodsMainImg(), SizeUtils.dp2px(2), icon);
        helper.setText(R.id.tv_name, item.getGoodsName());
        helper.setText(R.id.tv_price, "¥" + item.getGoodsPrice());
        helper.setText(R.id.tv_yue_xiao, "月销" + item.getGoodsSaleNum());
    }
}
